import request from '@/utils/request'

// 勤务规划相关接口

/**
 * 获取勤务规划列表
 * @param {Object} query 查询参数
 */
export function listDutyPlans(query) {
  return request({
    url: '/bussiness/duty/plans',
    method: 'get',
    params: query
  })
}

/**
 * 保存勤务规划
 * @param {Object} data 勤务规划数据
 */
export function saveDutyPlan(data) {
  return request({
    url: '/bussiness/duty/plan',
    method: 'post',
    data: data
  })
}

/**
 * 删除勤务规划
 * @param {Number} dutyPlanId 勤务规划ID
 */
export function deleteDutyPlan(dutyPlanId) {
  return request({
    url: `/bussiness/duty/plan/${dutyPlanId}`,
    method: 'delete'
  })
}

/**
 * 获取巡逻点列表
 * @param {Object} query 查询参数
 */
export function listPatrolPoints(query) {
  return request({
    url: '/bussiness/duty/patrolPoints',
    method: 'get',
    params: query
  })
}

/**
 * 保存巡逻点
 * @param {Object} data 巡逻点数据
 */
export function savePatrolPoint(data) {
  return request({
    url: '/bussiness/duty/patrolPoint',
    method: 'post',
    data: data
  })
}

/**
 * 删除巡逻点
 * @param {Number} pointId 巡逻点ID
 */
export function deletePatrolPoint(pointId) {
  return request({
    url: `/bussiness/duty/patrolPoint/${pointId}`,
    method: 'delete'
  })
}

/**
 * 获取巡逻路线列表
 * @param {Object} query 查询参数
 */
export function listPatrolRoutes(query) {
  return request({
    url: '/bussiness/duty/patrolRoutes',
    method: 'get',
    params: query
  })
}

/**
 * 保存巡逻路线
 * @param {Object} data 巡逻路线数据
 */
export function savePatrolRoute(data) {
  return request({
    url: '/bussiness/duty/patrolRoute',
    method: 'post',
    data: data
  })
}

/**
 * 删除巡逻路线
 * @param {Number} routeId 巡逻路线ID
 */
export function deletePatrolRoute(routeId) {
  return request({
    url: `/bussiness/duty/patrolRoute/${routeId}`,
    method: 'delete'
  })
}

/**
 * 获取装备列表
 * @param {Object} query 查询参数
 */
export function listEquipment(query) {
  return request({
    url: '/bussiness/duty/equipment',
    method: 'get',
    params: query
  })
}

/**
 * 分配装备
 * @param {Object} data 装备分配数据
 */
export function assignEquipment(data) {
  return request({
    url: '/bussiness/duty/equipment/assign',
    method: 'post',
    data: data
  })
}

/**
 * 获取勤务明细列表
 * @param {Object} query 查询参数
 */
export function listDutyDetails(query) {
  return request({
    url: '/bussiness/duty/details',
    method: 'get',
    params: query
  })
}

/**
 * 导出勤务安排
 * @param {Object} query 查询参数
 */
export function exportDutyPlan(query) {
  return request({
    url: '/bussiness/duty/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
} 